<%-- 
    Document   : db1
    Created on : 2014/8/19, 下午 01:26:13
    Author     : gjun
--%>

<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    String id = request.getParameter("id");//宣告要刪除ID
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "root");
    Statement st=con.createStatement();
    String sql="delete from person where id=" +id;//刪掉id

    int x = st.executeUpdate(sql);
    st.close();
    con.close();
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>delete</title>
    </head>
    <body>
        <h1>delete</h1>
        <%= x %>
        <a href="list.jsp">回到清單</a>
    </body>
</html>
